<template>
	<xbd-pages-content title="员工考勤统计">
		<template #content>
			<view class="search-staff">
				<view class="search-ipt">
					<uni-easyinput v-model="value" placeholder="请输入员工姓名" placeholderStyle="color: #999999;" @iconClick="iconClick"></uni-easyinput>
				</view>
				<view class="list" v-if="value">
					<view class="row" @click="backStatistics">
						<image class="img" src="@/static/images/workattendance/search.svg" mode=""></image>
						<view class="name">
							张三
						</view>
					</view>
				</view>
			</view>
		</template>
	</xbd-pages-content>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				list: []
			};
		},
		methods: {
			iconClick(e) {
				console.log(e);
			},
			backStatistics() {
				uni.$emit('searchVal', {name: '小明', department: '秘书部'});
				uni.navigateBack({
					delta: 1
				});
			}
		},
		watch: {
			value(val) {
				if (val === '') {
					console.log(2312);
					this.list = [];
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.search-staff {
		.search-ipt {
			padding: 20px 50rpx;
			margin-bottom: 10px;
			
			background-color: #FFFFFF;
		}
		.list {
			padding: 20px 40rpx;
			
			background-color: #FFFFFF;
			.row {
				display: flex;
				align-items: center;
				
				padding-bottom: 10px;
				margin-bottom: 10px;
				
				border-bottom: 1px dashed #EEEEEE;
				.img {
					width: 32rpx;
					height: 32rpx;
					margin-right: 10rpx;
				}
				.name {
					font-size: 12px;
					
					color: $uni-text-color;
				}
			}
		}
	}
</style>
